Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Lisp reader</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Lisp_reader"> <link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Lisp_reader rootpage-Lisp_reader skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Lisp reader</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><p>In the programming language <a href="Lisp_(programming_language)" title="Lisp (programming language)">Lisp</a>, the <b>reader</b> or <b><code>read</code> function</b> is the <a href="Parser" class="mw-redirect" title="Parser">parser</a> which converts the textual form of Lisp objects to the corresponding internal object structure.
</p><p>In the original Lisp, S-expressions consisted only of <a href="Symbol_(programming)" title="Symbol (programming)">symbols</a>, integers, and the list constructors <code>( <i>x<sub>i</sub>...</i> )</code> and <code>(<i>x</i> . <i>y</i>)</code>. Later Lisps, culminating in <a href="Common_Lisp" title="Common Lisp">Common Lisp</a>, added literals for floating-point, complex, and rational numbers, strings, and constructors for vectors.
</p><p>The reader is responsible for parsing list structure, <a href="String_interning" title="String interning">interning</a> symbols, converting numbers to internal form, and calling read macros.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Read_table">Read table</h2></div>
<p>The reader is controlled by the <code>readtable</code>, which defines the meaning of each <a href="Character_(computing)" title="Character (computing)">character</a>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Read_macros">Read macros</h2></div>
<p>Unlike most programming languages, Lisp supports parse-time execution of programs, called "read macros" or "reader macros". These are used to extend the syntax either in universal or program-specific ways. For example, the <a href="Lisp_(programming_language)#Self-evaluating_forms_and_quoting" title="Lisp (programming language)">quoted form</a> <code>(quote <i>x</i>)</code> operator can be abbreviated as <code><span class="nowrap" style="padding-left:0.1em;">'</span><i>x</i></code>. The <code>'</code> operator can be defined as a read macro which reads the following list and wraps it with <code>quote</code>. Similarly, the <a href="Lisp_(programming_language)#Backquote" title="Lisp (programming language)">backquote operator</a> (` ) can be defined as a read macro.
</p>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
</div>
<div class="mw-heading mw-heading2"><h2 id="Bibliography">Bibliography</h2></div>
<ul><li><a href="John_McCarthy_(computer_scientist)" title="John McCarthy (computer scientist)">John McCarthy</a> <i>et al.</i>, <i>LISP 1.5 Programmer's Manual</i>, MIT Press, 1962.</li>
<li><a href="David_A._Moon" title="David A. Moon">David A. Moon</a>, <i>MACLISP Reference Manual</i>, 1974.</li>
<li><a href="Guy_Steele" class="mw-redirect" title="Guy Steele">Guy Steele</a>, <i>Common LISP: The Language</i>, Second Edition, 1990.</li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2017-01-06" href="https://en.wikipedia.org/wiki/?title=Lisp_reader&amp;oldid=758560757">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>